package com.ecommerce.model;

public class ProductSales {
    private int productId;
    private String productName;
    private int quantitySold;
    private double totalRevenue;

    public ProductSales() {}

    // Getters and Setters
    public int getProductId() { return productId; }
    public void setProductId(int productId) { this.productId = productId; }

    public String getProductName() { return productName; }
    public void setProductName(String productName) { this.productName = productName; }

    public int getQuantitySold() { return quantitySold; }
    public void setQuantitySold(int quantitySold) { this.quantitySold = quantitySold; }

    public double getTotalRevenue() { return totalRevenue; }
    public void setTotalRevenue(double totalRevenue) { this.totalRevenue = totalRevenue; }

    @Override
    public String toString() {
        return String.format("商品: %s | 销量: %d | 营收: ¥%.2f",
                productName, quantitySold, totalRevenue);
    }
}